Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the config ajustment script of TLS for ENTROPY_NV_SEED #7877

Merged
merged 1 commit into from Oct 10, 2018

Conversation

TomoYamanaka
Copy link
Contributor

Description

I think that ENTROPY_NV_SEED is one of "entropy", but it doesn't included to the "!defined" lineup in the following config file.
mbed-os\features\mbedtls\inc\mbedtls\config.h
Therefore, when MBEDTLS_ENTROPY_NV_SEED is defined, it is accidently invoked mbedtls/config-no-entropy.h at line 40.

I think that it should go through line 47 in the case of MBEDTLS_ENTROPY_NV_SEED.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Breaking change

@JanneKiiskila
Copy link
Contributor

@andcor02 - please review.

@TomoYamanaka
Copy link
Contributor Author

How is it going?

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 29, 2018

@k-stachowiak Can you review or someone from your team?

@JanneKiiskila
Copy link
Contributor

Should this actually be done to the upstream MbedTLS repo, rather than Mbed OS? MbedTLS releases are done from the MbedTLS repo.

@simonbutcher
Copy link
Contributor

This is changing code that's automatically generated by the Mbed TLS import script which you can see here.

You need to change the import script not the file itself.

cc: @RonEld, @dreemkiller

Copy link
Contributor

@simonbutcher simonbutcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the wrong code.

@JanneKiiskila
Copy link
Contributor

Although "nv_seed" is one of "entropy", it doesn't included to the "!defined" lineup in the following config file.
Therefore, when MBEDTLS_ENTROPY_NV_SEED is defined, it is accidently invoked "mbedtls/config-no-entropy.h".
mbed-os\features\mbedtls\inc\mbedtls\config.h
I think that correct processing should go to line 47, not line 40.
@TomoYamanaka TomoYamanaka changed the title Improve MBEDTLS config for ENTROPY_NV_SEED Improve the config ajustment script of TLS for ENTROPY_NV_SEED Aug 31, 2018
@TomoYamanaka
Copy link
Contributor Author

@sbutcher-arm @JanneKiiskila
I changed my commit. Does this make sense?

"#include MBEDTLS_USER_CONFIG_FILE\n" \
"#endif\n" \
"\n" \
add_code \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code which looks identical is marked as changed. Are there some whitespace errors in here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think there is such an error. I just added spaces to align the end of line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the following viewer that hides whitespace changes, you can check that there is not some whitespace errors.
https://github.com/ARMmbed/mbed-os/pull/7877/files?utf8=%E2%9C%93&diff=unified&w=1
Thus, this is due to the Diff settings.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have checked on my machine, and the diff is because the alignment of the ending \ has changed:
image
This is because the addition of \\\\ at line 49 to add the " !defined(MBEDTLS_ENTROPY_NV_SEED)\n" part in line 50, i believe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RonEld Thank you for comments, it is correct.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok - the Mbed TLS coding standards specify 79 columns, but Mbed permit 120 and this is Mbed OS, so this is acceptable.

@simonbutcher
Copy link
Contributor

@TomoYamanaka - The problem with this code and this area is that it needs to work for lots of different types of targets and platforms. Can you say what targets you've tested this with? A build test is all that's needed - not necessarily to test and run it.

@TomoYamanaka
Copy link
Contributor Author

TomoYamanaka commented Sep 3, 2018

@sbutcher-arm

Can you say what targets you've tested this with?

My target is GR-PEACH that is Renesas Mbed board. Since it has not a hardware entropy(TRNG), we're considering that accessing to Mbed Cloud by utilizing NV_SEED entropy.

@TomoYamanaka
Copy link
Contributor Author

Is there anything else required?

"#include MBEDTLS_USER_CONFIG_FILE\n" \
"#endif\n" \
"\n" \
add_code \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok - the Mbed TLS coding standards specify 79 columns, but Mbed permit 120 and this is Mbed OS, so this is acceptable.

@simonbutcher
Copy link
Contributor

This is a trivial change, so I think I can accept the level of testing, assuming it passed the Mbed Cloud Client CI.

@JanneKiiskila
Copy link
Contributor

I don't think the Cloud Client test would verify that configuration per se.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 9, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 10, 2018

Build : SUCCESS

Build number : 3303
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7877/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Oct 10, 2018

@mbed-ci
Copy link

mbed-ci commented Oct 10, 2018

@cmonr cmonr merged commit 0cf26eb into ARMmbed:master Oct 10, 2018
@TomoYamanaka TomoYamanaka deleted the improve_nv_seed_of_tls branch October 11, 2018 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants